using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace Network_Tools_Windows
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnPing_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked == false)
                Process.Start(@"C:\Windows\System32\cmd.exe", @"/C ping " + textBox1.Text);
            else
                Process.Start(@"C:\Windows\System32\cmd.exe", @"/C ping " + textBox1.Text + " -t");
        }

        private void btnTracert_Click(object sender, EventArgs e)
        {
            Process.Start(@"C:\Windows\System32\cmd.exe", @"/C tracert " + textBox1.Text);
        }

        private void btn_telnet_Click(object sender, EventArgs e)
        {
            Process.Start(@"C:\Windows\System32\cmd.exe", @"/C telnet " + textBox1.Text + " " + textBox2.Text);
        }

        private void btn_nslookup_Click(object sender, EventArgs e)
        {
            Process.Start(@"C:\Windows\System32\cmd.exe", @"/C nslookup " + textBox1.Text);
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Yep, you guessed it! More crap from Duane Wolff!", "Oh no! Not again!");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (checkBox2.Checked == false)
                Process.Start(@"C:\Windows\System32\cmd.exe", @"/C netstat " + textBox3.Text);
            else
                Process.Start(@"C:\Windows\System32\cmd.exe", @"/C netstat -b -v " + textBox3.Text);
        }

        private void netshGUIToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Process.Start(@"C:\Program Files\Microsoft Network Monitor 3\netmon.exe");
        }


    }
}